package com.it.heima.dao.impl;

import com.it.heima.dao.EmpDao;
import com.it.heima.pojo.Emp;
import com.it.heima.util.XmlParserUtils;
import org.springframework.stereotype.Component;

import java.util.List;
@Component

public class EmpDaoA implements EmpDao {


    @Override

    public List<Emp> listEmp() {

            //1. 加载并解析emp.xml
            String file = this.getClass().getClassLoader().getResource("emp.xml").getFile();
            System.out.println(file);
            List<Emp> empList = XmlParserUtils.parse(file, Emp.class);
            return empList;

    }
}
